/*
@Time : 2020/7/30 13:40
@Author : lym
@File : UserRouter.go
@Software: GoLand
*/
package router

import (
	"gin-YiStudio-V1/aspect"
	"gin-YiStudio-V1/controller"
	"gin-YiStudio-V1/middleware"
	"github.com/gin-gonic/gin"
)

/**
 * @Author lym
 * @Description user路由 [登录，注册]
 * @Date 2020-07-30, 星期四 13:46
 * @Param
 * @return
 **/
func InitUserRouter(router *gin.Engine) {

	userGroup := router.Group("v1").Use(aspect.CommonrHandlerFunc()).Use(aspect.UserHandlerFunc())
	{
		userGroup.POST("/api/auth/login", controller.Login)
		userGroup.POST("/api/auth/register", controller.Register)
		userGroup.GET("/api/auth/info", middleware.AuthMiddleware(), controller.Info)
	}
}
